﻿//////////////////////////////////////////////////////////////////
//
// MRUArchive.cs
//
// Copyright (c) 2012 Dan Pike. All rights reserved
//
// Refer to license.txt for any license restrictions.
// 
using System;
using System.Configuration;

namespace Utilities
{
   [ConfigurationCollection(typeof(MRUArchive), AddItemName = "filename", CollectionType = ConfigurationElementCollectionType.BasicMap)]
   public class MRUArchive : Utilities.ArchiveCollection<Utilities.MRUArchiveFilename>
   {
      //////////////////////////////////////////////////////////////////////////
      //
      public MRUArchive()
      {
      }

      //////////////////////////////////////////////////////////////////////////
      //
      protected override ConfigurationElement create(string key)
      {
         MRUArchiveFilename element = new MRUArchiveFilename();
         element.path = key;
         return element;
      }

      //////////////////////////////////////////////////////////////////////////
      //
      protected override object GetElementKey(ConfigurationElement element)
      {
         return (element as MRUArchiveFilename).path;
      }

      ////////////////////////////////////////////////////////////////////////

      protected override string ElementName
      {
         get { return "filename"; }
      }
   }
}
